package com.enjoyor.soa.traffic.frame.support.kafka.template;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class KafkaReceiverTemplate {

    @KafkaListener(topics = { "template" }, containerFactory = "kafkaListenerContainerFactory")
    public void listen(ConsumerRecord<?, ?> record) {
        System.out.println("########################## KafkaReceiver start################################");
        System.out.println(String.format("{%s}|{%s}|{%s}|{%s}", record.topic(), record.partition(), record.offset(),
                record.value()));
        System.out.println("########################## KafkaReceiver end################################");
    }

}
